package router

import (
	"ecomm-pro/handler"
	"net/http"

	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("/login", handler.Login)                    //用户登录
	r.POST("/roleNodeAdd", handler.RoleNodeAdd)        //角色添加
	r.POST("/userRoleAdd", handler.UserRoleAdd)        //权限添加
	r.GET("/roleNodeList", handler.RoleNodeList)       //查询角色的信息rid
	r.GET("/userRoleList", handler.UserRoleList)       //查询用户的信息uid
	r.POST("/shopAdd", handler.ShopAdd)                //商品信息添加
	r.POST("/shopOrderAdd", handler.ShopOrderAdd)      //商品订单信息添加
	r.GET("/shopOrderList", handler.ShopOrderList)     //商品订单列表
	r.GET("/shopOrderDetail", handler.ShopOrderDetail) //商品订单详情
	return r
}
